package com.project.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * 请求地址配置
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "request.url")
public class PassUrlConfig {
    private List<String> pass;

    public String[] getPassPaths() {
        int i = 0;
        String[] ps = new String[pass.size()];
        for (String p : pass) {
            if (p.endsWith("/")) {
                p = p.concat("**");
            }
            ps[i] = p;
            i++;
        }
        return ps;
    }
}
